/*
 Name:		DataCameraBattery.ino
 Created:	2018/10/20 14:22:00
 Author:	ZDING
*/

#include "BatteryModule.h"
#include "subModule.h"

string id = "test module";
// the setup function runs once when you press reset or power the board

BatteryModule batteryModule = BatteryModule();
SubModule subModule = SubModule(id);

void setup() {	
	Serial.println("Battery Module init...");
	batteryModule.init();
	subModule.subModuleInit();
}

// the loop function runs over and over again until power down or reset
void loop() {
	uint8_t ADCpercent;
	Serial.println("ADC Read Battery Percent:");
	
	ADCpercent = batteryModule.getBatteryPercent();
	Serial.println(ADCpercent);
	subModule.refresTxhData((uint8_t*)&ADCpercent, 1);

	Serial.println("LED Read Battery:");
	Serial.println(batteryModule.getLED());
	Serial.println("----------------------");
	delay(2000);

}
